package com.winit.need.model;

import com.winit.issue.model.Issue;
import org.springframework.util.StringUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Need {
    private String id;

    private String createrAccount;

    private String createrName;

    private Date createTime;

    private String title;

    private String source;

    private String status;

    private String proposerAccount;

    private String proposerName;

    private String followAccount;

    private String followName;

    private String star;

    private String deptChargeAccount;

    private String deptChargeName;

    private Date expectedSchedule;

    private String deptPriority;

    private String deptTrain;

    private String reduceLoss;

    private String profit;

    private String delayDay;

    private String attrConfigId;

    private Date reviewUpdateTime;

    private String pdmNeedType;

    private String pdmPriority;

    private Date pdmClearTime;

    private String isFallback;

    private String fallbackReason;

    private Integer pdmCount;

    private Integer uiCount;

    private Integer devCount;

    private Integer qaCount;

    private String cycle;

    private String needDesc;

    private String purpose;

    private String pdmDesc;

    private String isDel;

    private List<NeedPdm> needPdm;

    private List<NeedPage> needPage;

    private List<Issue> issues;


    //受理时间
    private Date admissibilityTime;
    //实际完成时间
    private Date actualCompletionTime;
    //
    private Date expectedTime;
    //受理状态
    private String admissibilityStatus;
//    需求部门
    private String needDept;

    //受理人信息
    private String acceptAccount;
    private String acceptName;

    private String starType;
    private String statusTimes;
    private String expectLowerCost;
    private String cycleStatus;
    private String isComplete;
    private String completeReason;
    private String otherPurposes;
    private String appointAcceptAccount;
    private String appointAcceptName;

//    客户编码
    private String customerCode;
//    客户名称
    private String customerName;
//    工单号
    private String ticketNumber;
//    工单链接
    private String ticketUrl;

    private String customerType;

    //部门评审的参考价值
    private String deptRefValue;

    private List<NeedLowerCost> expectLowerCostList;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id == null ? null : id.trim();
    }

    public String getCreaterAccount() {
        return createrAccount;
    }

    public void setCreaterAccount(String createrAccount) {
        this.createrAccount = createrAccount == null ? null : createrAccount.trim();
    }

    public String getCreaterName() {
        return createrName;
    }

    public void setCreaterName(String createrName) {
        this.createrName = createrName == null ? null : createrName.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source == null ? null : source.trim();
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public String getProposerAccount() {
        return proposerAccount;
    }

    public void setProposerAccount(String proposerAccount) {
        this.proposerAccount = proposerAccount == null ? null : proposerAccount.trim();
    }

    public String getProposerName() {
        return proposerName;
    }

    public void setProposerName(String proposerName) {
        this.proposerName = proposerName == null ? null : proposerName.trim();
    }

    public String getFollowAccount() {
        return followAccount;
    }

    public void setFollowAccount(String followAccount) {
        this.followAccount = followAccount == null ? null : followAccount.trim();
    }

    public String getFollowName() {
        return followName;
    }

    public void setFollowName(String followName) {
        this.followName = followName == null ? null : followName.trim();
    }

    public String getStar() {
        return star;
    }

    public void setStar(String star) {
        this.star = star == null ? null : star.trim();
    }

    public String getDeptChargeAccount() {
        return deptChargeAccount;
    }

    public void setDeptChargeAccount(String deptChargeAccount) {
        this.deptChargeAccount = deptChargeAccount == null ? null : deptChargeAccount.trim();
    }

    public String getDeptChargeName() {
        return deptChargeName;
    }

    public void setDeptChargeName(String deptChargeName) {
        this.deptChargeName = deptChargeName == null ? null : deptChargeName.trim();
    }

    public Date getExpectedSchedule() {
        return expectedSchedule;
    }

    public void setExpectedSchedule(Date expectedSchedule) {
        this.expectedSchedule = expectedSchedule;
    }

    public String getDeptPriority() {
        return deptPriority;
    }

    public void setDeptPriority(String deptPriority) {
        this.deptPriority = deptPriority == null ? null : deptPriority.trim();
    }

    public String getDeptTrain() {
        return deptTrain;
    }

    public void setDeptTrain(String deptTrain) {
        this.deptTrain = deptTrain == null ? null : deptTrain.trim();
    }

    public String getReduceLoss() {
        return reduceLoss;
    }

    public void setReduceLoss(String reduceLoss) {
        this.reduceLoss = reduceLoss == null ? null : reduceLoss.trim();
    }

    public String getProfit() {
        return profit;
    }

    public void setProfit(String profit) {
        this.profit = profit == null ? null : profit.trim();
    }

    public String getDelayDay() {
        return delayDay;
    }

    public void setDelayDay(String delayDay) {
        this.delayDay = delayDay == null ? null : delayDay.trim();
    }

    public String getAttrConfigId() {
        return attrConfigId;
    }

    public void setAttrConfigId(String attrConfigId) {
        this.attrConfigId = attrConfigId == null ? null : attrConfigId.trim();
    }

    public Date getReviewUpdateTime() {
        return reviewUpdateTime;
    }

    public void setReviewUpdateTime(Date reviewUpdateTime) {
        this.reviewUpdateTime = reviewUpdateTime;
    }

    public String getPdmNeedType() {
        return pdmNeedType;
    }

    public void setPdmNeedType(String pdmNeedType) {
        this.pdmNeedType = pdmNeedType == null ? null : pdmNeedType.trim();
    }

    public String getPdmPriority() {
        return pdmPriority;
    }

    public void setPdmPriority(String pdmPriority) {
        this.pdmPriority = pdmPriority == null ? null : pdmPriority.trim();
    }

    public Date getPdmClearTime() {
        return pdmClearTime;
    }

    public void setPdmClearTime(Date pdmClearTime) {
        this.pdmClearTime = pdmClearTime;
    }

    public String getIsFallback() {
        return isFallback;
    }

    public void setIsFallback(String isFallback) {
        this.isFallback = isFallback == null ? null : isFallback.trim();
    }

    public String getFallbackReason() {
        return fallbackReason;
    }

    public void setFallbackReason(String fallbackReason) {
        this.fallbackReason = fallbackReason == null ? null : fallbackReason.trim();
    }

    public Integer getPdmCount() {
        return pdmCount;
    }

    public void setPdmCount(Integer pdmCount) {
        this.pdmCount = pdmCount;
    }

    public Integer getUiCount() {
        return uiCount;
    }

    public void setUiCount(Integer uiCount) {
        this.uiCount = uiCount;
    }

    public Integer getDevCount() {
        return devCount;
    }

    public void setDevCount(Integer devCount) {
        this.devCount = devCount;
    }

    public Integer getQaCount() {
        return qaCount;
    }

    public void setQaCount(Integer qaCount) {
        this.qaCount = qaCount;
    }

    public String getCycle() {
        return cycle;
    }

    public void setCycle(String cycle) {
        this.cycle = cycle == null ? null : cycle.trim();
    }

    public String getPurpose() {
        return purpose;
    }

    public void setPurpose(String purpose) {
        this.purpose = purpose == null ? null : purpose.trim();
    }

    public String getPdmDesc() {
        return pdmDesc;
    }

    public void setPdmDesc(String pdmDesc) {
        this.pdmDesc = pdmDesc == null ? null : pdmDesc.trim();
    }

    public String getNeedDesc() {
        return needDesc;
    }

    public void setNeedDesc(String needDesc) {
        this.needDesc = needDesc;
    }

    public List<NeedPdm> getNeedPdm() {
        return needPdm;
    }

    public void setNeedPdm(List<NeedPdm> needPdm) {
        this.needPdm = needPdm;
    }

    public List<NeedPage> getNeedPage() {
        return needPage;
    }

    public void setNeedPage(List<NeedPage> needPage) {
        this.needPage = needPage;
    }

    public List<Issue> getIssues() {
        return issues;
    }

    public void setIssues(List<Issue> issues) {
        this.issues = issues;
    }

    public Date getAdmissibilityTime() {
        return admissibilityTime;
    }

    public void setAdmissibilityTime(Date admissibilityTime) {
        this.admissibilityTime = admissibilityTime;
    }

    public Date getActualCompletionTime() {
        return actualCompletionTime;
    }

    public void setActualCompletionTime(Date actualCompletionTime) {
        this.actualCompletionTime = actualCompletionTime;
    }

    public Date getExpectedTime() {
        return expectedTime;
    }

    public void setExpectedTime(Date expectedTime) {
        this.expectedTime = expectedTime;
    }

    public String getAdmissibilityStatus() {
        return admissibilityStatus;
    }

    public void setAdmissibilityStatus(String admissibilityStatus) {
        this.admissibilityStatus = admissibilityStatus;
    }

    public String getIsDel() {
        return isDel;
    }

    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }

    public String getAcceptAccount() {
        return acceptAccount;
    }

    public void setAcceptAccount(String acceptAccount) {
        this.acceptAccount = acceptAccount;
    }

    public String getAcceptName() {
        return acceptName;
    }

    public void setAcceptName(String acceptName) {
        this.acceptName = acceptName;
    }

    public void setStarType(String starType) {
        this.starType = starType;
    }

    public String getStarType() {
        return starType;
    }

    public String getStatusTimes() {
        return statusTimes;
    }

    public void setStatusTimes(String statusTimes) {
        this.statusTimes = statusTimes;
    }

    public String getExpectLowerCost() {
        return expectLowerCost;
    }

    public void setExpectLowerCost(String expectLowerCost) {
        this.expectLowerCost = expectLowerCost;
    }

    public List<NeedLowerCost> getExpectLowerCostList() {
        List<NeedLowerCost> rtn = new ArrayList<>();
        if (StringUtils.isEmpty(this.expectLowerCost)) {
            return rtn;
        }
        String[] list = this.expectLowerCost.split(";");
        for (String cost : list) {
            NeedLowerCost lowerCost = new NeedLowerCost();
            lowerCost.setRole(cost.split(",")[0]);
            lowerCost.setUserNum(cost.split(",")[1]);
            lowerCost.setCycle(cost.split(",")[2]);
            lowerCost.setHours(cost.split(",")[3]);
            rtn.add(lowerCost);
        }
        return rtn;
    }

    public void setExpectLowerCostList(List<NeedLowerCost> expectLowerCostList) {
        this.expectLowerCostList = expectLowerCostList;
        if (expectLowerCostList.size() > 0) {
            StringBuffer string = new StringBuffer();
            for (NeedLowerCost lowerCost : expectLowerCostList) {
                string.append(lowerCost.getRole()).append(",").append(lowerCost.getUserNum()).append(",")
                        .append(lowerCost.getCycle()).append(",").append(lowerCost.getHours()).append(";");
            }
            this.expectLowerCost = string.substring(0, string.length() - 1);
        }
    }

    public String getCycleStatus() {
        return cycleStatus;
    }

    public void setCycleStatus(String cycleStatus) {
        this.cycleStatus = cycleStatus;
    }

    public String getIsComplete() {
        return isComplete;
    }

    public void setIsComplete(String isComplete) {
        this.isComplete = isComplete;
    }

    public String getCompleteReason() {
        return completeReason;
    }

    public void setCompleteReason(String completeReason) {
        this.completeReason = completeReason;
    }

    public String getOtherPurposes() {
        return otherPurposes;
    }

    public void setOtherPurposes(String otherPurposes) {
        this.otherPurposes = otherPurposes;
    }

    public String getAppointAcceptAccount() {
        return appointAcceptAccount;
    }

    public void setAppointAcceptAccount(String appointAcceptAccount) {
        this.appointAcceptAccount = appointAcceptAccount;
    }

    public String getAppointAcceptName() {
        return appointAcceptName;
    }

    public void setAppointAcceptName(String appointAcceptName) {
        this.appointAcceptName = appointAcceptName;
    }

    public String getCustomerCode() {
        return customerCode;
    }

    public void setCustomerCode(String customerCode) {
        this.customerCode = customerCode;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getTicketNumber() {
        return ticketNumber;
    }

    public void setTicketNumber(String ticketNumber) {
        this.ticketNumber = ticketNumber;
    }

    public String getTicketUrl() {
        return ticketUrl;
    }

    public void setTicketUrl(String ticketUrl) {
        this.ticketUrl = ticketUrl;
    }

    public String getNeedDept() {
        return needDept;
    }

    public void setNeedDept(String needDept) {
        this.needDept = needDept;
    }

    public String getCustomerType() {
        return customerType;
    }

    public void setCustomerType(String customerType) {
        this.customerType = customerType;
    }

    public String getDeptRefValue() {
        return deptRefValue;
    }

    public void setDeptRefValue(String deptRefValue) {
        this.deptRefValue = deptRefValue;
    }
}